package com.ssy.lingxi.member.merchant.controller.mobile;

import com.ssy.lingxi.common.model.vo.PageVO;
import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.member.merchant.model.vo.basic.request.MobileUserPageVO;
import com.ssy.lingxi.member.merchant.model.vo.basic.request.UpdateRegisterDetailVO;
import com.ssy.lingxi.member.merchant.model.vo.basic.request.UpperMemberIdRoleIdVO;
import com.ssy.lingxi.member.merchant.model.vo.basic.response.RegisterDetailGroupVO;
import com.ssy.lingxi.member.merchant.model.vo.basic.response.UserQueryVO;
import com.ssy.lingxi.member.merchant.model.vo.info.response.MobileInfoBasicDetailVO;
import com.ssy.lingxi.member.merchant.model.vo.info.response.MobileInfoLevelRightQueryVO;
import com.ssy.lingxi.member.merchant.model.vo.info.response.MobileInfoLevelRightVO;
import com.ssy.lingxi.member.merchant.model.vo.maintenance.response.MemberDetailLevelHistoryVO;
import com.ssy.lingxi.member.merchant.model.vo.maintenance.response.MemberDetailRightConfigVO;
import com.ssy.lingxi.member.merchant.model.vo.maintenance.response.MemberDetailRightHistoryVO;
import com.ssy.lingxi.member.merchant.model.vo.maintenance.response.MemberDetailRightSpendHistoryVO;
import com.ssy.lingxi.member.merchant.model.vo.mobile.request.*;
import com.ssy.lingxi.member.merchant.model.vo.mobile.response.MobileInfoApplyButtonVO;
import com.ssy.lingxi.member.merchant.model.vo.mobile.response.MobileUpdateDepositDetailQueryVO;
import com.ssy.lingxi.member.merchant.service.mobile.IMobileMemberInfoService;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;

/**
 * @menu App - 会员信息查询相关接口
 * @author 万宁
 * @version 2.0.0
 * @date 2020-12-08
 */
@RestController
@RequestMapping("/member/mobile/info")
public class MobileMemberInfoController {
    @Resource
    private IMobileMemberInfoService mobileMemberInfoService;

    /**
     * “我的-卡包” - 分页查询归属会员列表
     * @param headers Http头部信息
     * @param pageVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/mine/page", method = RequestMethod.GET)
    public Wrapper<PageData<MobileInfoLevelRightQueryVO>> pageUpperMemberLevelRights(@RequestHeader HttpHeaders headers, @Valid PageVO pageVO) {
        return mobileMemberInfoService.pageUpperMemberLevelRights(headers, pageVO);
    }

    /**
     * “会员中心” - 查询当前会员的等级、权益信息
     * @param headers Http头部信息
     * @param shopVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/detail/level/right/basic", method = RequestMethod.GET)
    public Wrapper<MobileInfoLevelRightVO> getMemberDetailLevelRight(@RequestHeader HttpHeaders headers, @Valid MobileShopVO shopVO) {
        return mobileMemberInfoService.getMemberDetailLevelRight(headers, shopVO);
    }

    /**
     * “会员中心”  - 分页查询会员权益获取记录
     * @param headers Http头部信息
     * @param pageVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/detail/right/history/page", method = RequestMethod.GET)
    public Wrapper<PageData<MemberDetailRightHistoryVO>> pageMemberDetailRightHistory(@RequestHeader HttpHeaders headers, @Valid MobileShopPageVO pageVO) {
        return mobileMemberInfoService.pageMemberDetailRightHistory(headers, pageVO);
    }

    /**
     * “会员中心”  - 分页查询会员权益使用记录
     * @param headers Http头部信息
     * @param pageVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/detail/right/spend/history/page", method = RequestMethod.GET)
    public Wrapper<PageData<MemberDetailRightSpendHistoryVO>> pageMemberDetailRightSpendHistory(@RequestHeader HttpHeaders headers, @Valid MobileShopPageVO pageVO) {
        return mobileMemberInfoService.pageMemberDetailRightSpendHistory(headers, pageVO);
    }

    /**
     * “会员中心”  - 分页查询活跃分获取记录
     * @param headers Http头部信息
     * @param pageVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/detail/level/history/page", method = RequestMethod.GET)
    public Wrapper<PageData<MemberDetailLevelHistoryVO>> pageMemberLevelDetailHistory(@RequestHeader HttpHeaders headers, @Valid MobileShopPageVO pageVO) {
        return mobileMemberInfoService.pageMemberLevelDetailHistory(headers, pageVO);
    }

    /**
     * “店铺会员”页面，查询“申请会员”按钮状态和文本
     * @param headers Http头部信息
     * @param upperMemberVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/apply/condition", method = RequestMethod.GET)
    public Wrapper<MobileInfoApplyButtonVO> getMobileApplyCondition(@RequestHeader HttpHeaders headers, @Valid UpperMemberIdRoleIdVO upperMemberVO) {
        return mobileMemberInfoService.getMobileApplyCondition(headers, upperMemberVO);
    }

    /**
     * “店铺会员”页面，查询“入会享特权”的权益列表
     * @param headers Http头部信息
     * @param upperMemberVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/apply/rights", method = RequestMethod.GET)
    public Wrapper<List<MemberDetailRightConfigVO>> getUpperMemberRights(@RequestHeader HttpHeaders headers, @Valid UpperMemberIdRoleIdVO upperMemberVO) {
        return mobileMemberInfoService.getUpperMemberRights(headers, upperMemberVO);
    }

    /**
     * “店铺会员”页面，查询申请成为会员时，需要填写的入库资料
     * @param headers Http头部信息
     * @param upperMemberVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/apply/deposit/detail", method = RequestMethod.GET)
    public Wrapper<List<RegisterDetailGroupVO>> findMobileApplyDepositDetails(@RequestHeader HttpHeaders headers, @Valid UpperMemberIdRoleIdVO upperMemberVO) {
        return mobileMemberInfoService.findMobileApplyDepositDetails(headers, upperMemberVO);
    }

    /**
     * “店铺会员”页面 - 提交申请
     * @param headers Http头部信息
     * @param subVO 接口参数
     * @return 申请结果
     */
    @RequestMapping(value = "/apply", method = RequestMethod.POST)
    public Wrapper<Void> applyToBeSubMember(@RequestHeader HttpHeaders headers, @RequestBody @Valid MobileApplyForSubVO subVO) {
        return mobileMemberInfoService.applyToBeSubMember(headers, subVO);
    }

    /**
     * “店铺会员”页面，修改入库资料时，查询入库资料
     * @param headers Http头部信息
     * @param upperMemberVO 上级会员信息
     * @return 查询结果
     */
    @RequestMapping(value = "/deposit/detail", method = RequestMethod.GET)
    public Wrapper<MobileUpdateDepositDetailQueryVO> getMemberDepositDetail(@RequestHeader HttpHeaders headers, @Valid UpperMemberIdRoleIdVO upperMemberVO) {
        return mobileMemberInfoService.getMemberDepositDetail(headers, upperMemberVO);
    }

    /**
     * “店铺会员”页面，当审核不通过时，修改入库资料
     * @param headers Http头部信息
     * @param depositDetailVO 接口参数
     * @return 修改结果
     */
    @RequestMapping(value = "/deposit/detail/update", method = RequestMethod.POST)
    public Wrapper<Void> updateDepositDetail(@RequestHeader HttpHeaders headers, @RequestBody @Valid MobileUpdateDepositDetailVO depositDetailVO) {
        return mobileMemberInfoService.updateDepositDetail(headers, depositDetailVO);
    }

    /**
     * “店铺会员” - 查询当前会员的等级、权益信息
     * @param headers Http头部信息
     * @param upperMemberIdRoleIdVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/shop/level/right/basic", method = RequestMethod.GET)
    public Wrapper<MobileInfoLevelRightVO> getShopMemberDetailLevelRight(@RequestHeader HttpHeaders headers, @Valid UpperMemberIdRoleIdVO upperMemberIdRoleIdVO) {
        return mobileMemberInfoService.getShopMemberDetailLevelRight(headers, upperMemberIdRoleIdVO);
    }

    /**
     * “店铺会员”  - 分页查询会员权益获取记录
     * @param headers Http头部信息
     * @param pageVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/shop/right/history/page", method = RequestMethod.GET)
    public Wrapper<PageData<MemberDetailRightHistoryVO>> pageShopMemberDetailRightHistory(@RequestHeader HttpHeaders headers, @Valid MobileUpperPageVO pageVO) {
        return mobileMemberInfoService.pageShopMemberDetailRightHistory(headers, pageVO);
    }

    /**
     * “店铺会员”  - 分页查询会员权益使用记录
     * @param headers Http头部信息
     * @param pageVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/shop/right/spend/history/page", method = RequestMethod.GET)
    public Wrapper<PageData<MemberDetailRightSpendHistoryVO>> pageShopMemberDetailRightSpendHistory(@RequestHeader HttpHeaders headers, @Valid MobileUpperPageVO pageVO) {
        return mobileMemberInfoService.pageShopMemberDetailRightSpendHistory(headers, pageVO);
    }

    /**
     * “店铺会员”  - 分页查询活跃分获取记录
     * @param headers Http头部信息
     * @param pageVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/shop/level/history/page", method = RequestMethod.GET)
    public Wrapper<PageData<MemberDetailLevelHistoryVO>> pageShopMemberLevelDetailHistory(@RequestHeader HttpHeaders headers, @Valid MobileUpperPageVO pageVO) {
        return mobileMemberInfoService.pageShopMemberLevelDetailHistory(headers, pageVO);
    }

    /**
     * “会员信息” - 会员基本信息
     * @param headers Http头部信息
     * @param shopVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/detail/basic", method = RequestMethod.GET)
    public Wrapper<MobileInfoBasicDetailVO> getMemberBasicDetail(@RequestHeader HttpHeaders headers, @Valid MobileShopVO shopVO) {
        return mobileMemberInfoService.getMemberBasicDetail(headers, shopVO);
    }

    /**
     * “会员信息” - 修改会员注册资料时，查询会员注册资料
     * @param headers Http头部信息
     * @return 查询结果
     */
    @RequestMapping(value = "/detail/update/get", method = RequestMethod.GET)
    public Wrapper<List<RegisterDetailGroupVO>> getMemberRegisterDetail(@RequestHeader HttpHeaders headers) {
        return mobileMemberInfoService.getMemberRegisterDetail(headers);
    }

    /**
     * “会员信息” - 修改会员注册资料
     * @param headers Http头部信息
     * @param detailVO 接口参数
     * @return 修改结果
     */
    @RequestMapping(value = "/detail/update", method = RequestMethod.POST)
    public Wrapper<Void> updateMemberRegisterDetail(@RequestHeader HttpHeaders headers, @RequestBody @Valid UpdateRegisterDetailVO detailVO) {
        return mobileMemberInfoService.updateMemberRegisterDetail(headers, detailVO);
    }

    /**
     * 分页查询会员下属用户
     * @param headers Http头部新
     * @param pageVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/users/page", method = RequestMethod.GET)
    public Wrapper<PageData<UserQueryVO>> pageUsers(@RequestHeader HttpHeaders headers, @Valid MobileUserPageVO pageVO) {
        return mobileMemberInfoService.pageUsers(headers, pageVO);
    }


//    /**
//     * 分页查询归属会员列表
//     * @param headers Http头部信息
//     * @param pageVO 接口参数
//     * @return 查询结果
//     */
//    @RequestMapping(value = "/page", method = RequestMethod.GET)
//    public Wrapper<PageData<UpperMemberInfoVO>> pageUpperMembers(@RequestHeader HttpHeaders headers, @Valid PageVO pageVO) {
//        return mobileMemberInfoService.pageUpperMembers(headers, pageVO);
//    }
//

//
//    /**
//     * 会员详情 - 会员权益 - 分页查询等级分获取记录
//     * @param headers Http头部信息
//     * @param pageVO 接口参数
//     * @return 查询结果
//     */
//    @RequestMapping(value = "/detail/level/history/page", method = RequestMethod.GET)
//    public Wrapper<PageData<MemberDetailLevelHistoryVO>> pageMemberLevelDetailHistory(@RequestHeader HttpHeaders headers, @Valid ValidateIdPageVO pageVO) {
//        return mobileMemberInfoService.pageMemberLevelDetailHistory(headers, pageVO);
//    }
//
//    /**
//     * 会员详情 - 会员诚信信息 - 会员基本信用信息
//     * @param headers Http头部信息
//     * @param idVO 接口参数
//     * @return 查询结果
//     */
//    @RequestMapping(value = "/detail/credit/basic", method = RequestMethod.GET)
//    public Wrapper<MemberDetailCreditVO> getMemberDetailCredit(@RequestHeader HttpHeaders headers, @Valid ValidateIdVO idVO) {
//        return mobileMemberInfoService.getMemberDetailCredit(headers, idVO);
//    }
//
//    /**
//     * 会员详情 - 会员信用信息 - 交易评价汇总
//     * @param headers Http头部信息
//     * @param idVO 接口参数
//     * @return 查询结果
//     */
//    @RequestMapping(value = "/detail/credit/trade/summary", method = RequestMethod.GET)
//    public Wrapper<MobileCommentSummaryVO> getMemberDetailCreditTradeCommentSummary(@RequestHeader HttpHeaders headers, @Valid ValidateIdVO idVO) {
//        return mobileMemberInfoService.getMemberDetailCreditTradeCommentSummary(headers, idVO);
//    }
//
//    /**
//     * 会员详情 - 会员信用 - 分页查询交易评论历史记录
//     * @param headers Http头部信息
//     * @param pageVO 接口参数
//     * @return 查询结果
//     */
//    @RequestMapping(value = "/detail/credit/trade/history/page", method = RequestMethod.GET)
//    public Wrapper<PageData<MemberDetailCreditTradeHistoryVO>> pageMemberDetailCreditTradeCommentHistory(@RequestHeader HttpHeaders headers, @Valid MemberDetailCreditHistoryPageVO pageVO) {
//        return mobileMemberInfoService.pageMemberDetailCreditTradeCommentHistory(headers, pageVO);
//    }
//
//    /**
//     * 会员详情 - 会员信用信息 - 售后评价汇总
//     * @param headers Http头部信息
//     * @param idVO 接口参数
//     * @return 查询结果
//     */
//    @RequestMapping(value = "/detail/credit/aftersale/summary", method = RequestMethod.GET)
//    public Wrapper<MobileCommentSummaryVO> getMemberDetailCreditAfterSaleCommentSummary(@RequestHeader HttpHeaders headers, @Valid ValidateIdVO idVO) {
//        return mobileMemberInfoService.getMemberDetailCreditAfterSaleCommentSummary(headers, idVO);
//    }
//
//    /**
//     * 会员详情 - 会员信用 - 分页查询售后评论历史记录
//     * @param headers Http头部信息
//     * @param pageVO 接口参数
//     * @return 查询结果
//     */
//    @RequestMapping(value = "/detail/credit/aftersale/history/page", method = RequestMethod.GET)
//    public Wrapper<PageData<MemberDetailCreditAfterSaleHistoryVO>> pageMemberDetailCreditAfterSaleCommentHistory(@RequestHeader HttpHeaders headers, @Valid MemberDetailCreditHistoryPageVO pageVO) {
//        return mobileMemberInfoService.pageMemberDetailCreditAfterSaleCommentHistory(headers, pageVO);
//    }
//
//    /**
//     * 会员详情 - 会员信用 - 投诉汇总
//     * @param headers Http头部信息
//     * @param idVO 接口参数
//     * @return 查询结果
//     */
//    @RequestMapping(value = "/detail/credit/complain/summary", method = RequestMethod.GET)
//    public Wrapper<MemberDetailCreditComplainSummaryVO> getMemberDetailCreditComplainSummary(@RequestHeader HttpHeaders headers, @Valid ValidateIdVO idVO) {
//        return mobileMemberInfoService.getMemberDetailCreditComplainSummary(headers, idVO);
//    }
//
//    /**
//     * 会员详情 - 会员信用 - 分页查询投诉历史记录
//     * @param headers Http头部信息
//     * @param pageVO 接口参数
//     * @return 查询结果
//     */
//    @RequestMapping(value = "/detail/credit/complain/history/page", method = RequestMethod.GET)
//    public Wrapper<PageData<MemberCreditComplaintPageQueryVO>> pageMemberDetailCreditComplainHistory(@RequestHeader HttpHeaders headers, @Valid ValidateIdPageVO pageVO) {
//        return mobileMemberInfoService.pageMemberDetailCreditComplainHistory(headers, pageVO);
//    }
//
//    /**
//     * 查询审批流程
//     * @param headers Http头部信息
//     * @param idVO 接口参数
//     * @return 查询结果
//     */
//    @RequestMapping(value = "/validate/step/list", method = RequestMethod.GET)
//    public Wrapper<ValidateStepVO> getMobileOuterValidateSteps(@RequestHeader HttpHeaders headers, @Valid ValidateIdVO idVO) {
//        return mobileMemberInfoService.getMobileOuterValidateSteps(headers, idVO);
//    }
//
//    /**
//     * 分页查询审核历史记录
//     * @param headers Http头部信息
//     * @param pageVO 接口参数
//     * @return 查询结果
//     */
//    @RequestMapping(value = "/validate/outer/history/page", method = RequestMethod.GET)
//    public Wrapper<PageData<MobileValidateHistoryVO>> pageMobileMemberOuterValidateHistory(@RequestHeader HttpHeaders headers, @Valid ValidateIdPageVO pageVO) {
//        return mobileMemberInfoService.pageMobileMemberOuterValidateHistory(headers, pageVO);
//    }
//
}
